import request from '@/api/request';

/**
 * 添加
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const resourceSaveApi = query => {
    return request({
        url: '/api/mgt/resource/save',
        method: 'post',
        data: query,
        isLoading: true
    });
};

/**
 * 删除
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const resourceRemoveApi = query => {
    return request({
        url: '/api/mgt/resource/removeByIds',
        method: 'delete',
        params: query,
        isLoading: true
    });
};

/**
 * 编辑
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const resourceEditApi = query => {
    return request({
        url: '/api/mgt/resource/edit',
        method: 'put',
        data: query,
        isLoading: true
    });
};

/**
 * 编辑状态
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const resourceEditStatusApi = query => {
    return request({
        url: '/api/mgt/resource/editStatus',
        method: 'put',
        params: query,
        isLoading: true
    });
};

/**
 * 编辑设为内置
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const resourceEditBuildInApi = query => {
    return request({
        url: '/api/mgt/resource/editBuildIn',
        method: 'put',
        params: query,
        isLoading: true
    });
};

/**
 * 分页
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const resourcePageApi = query => {
    return request({
        url: '/api/mgt/resource/page',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 详情
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const resourceDetailExtendApi = query => {
    return request({
        url: '/api/mgt/resource/getDetailExtend',
        method: 'get',
        params: query,
        isLoading: true
    });
};
